using ProcessManagementApi.DTOs;
using MESData.ErrorCode;

namespace ProcessManagementApi.Services
{
    /// <summary>
    /// 工序服务接口
    /// </summary>
    public interface IProcessService
    {
        /// <summary>
        /// 分页查询工序
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>分页结果</returns>
        Task<ApiPageing<ProcessResponseDto>> GetProcessesAsync(ProcessQueryDto query);

        /// <summary>
        /// 根据ID获取工序详情
        /// </summary>
        /// <param name="id">工序ID</param>
        /// <returns>工序详情</returns>
        Task<ApiResult<ProcessResponseDto>> GetProcessByIdAsync(int id);

        /// <summary>
        /// 创建工序
        /// </summary>
        /// <param name="createDto">创建DTO</param>
        /// <returns>创建结果</returns>
        Task<ApiResult<ProcessResponseDto>> CreateProcessAsync(ProcessCreateDto createDto);

        /// <summary>
        /// 更新工序
        /// </summary>
        /// <param name="updateDto">更新DTO</param>
        /// <returns>更新结果</returns>
        Task<ApiResult<ProcessResponseDto>> UpdateProcessAsync(ProcessUpdateDto updateDto);

        /// <summary>
        /// 删除工序
        /// </summary>
        /// <param name="id">工序ID</param>
        /// <returns>删除结果</returns>
        Task<ApiResult<bool>> DeleteProcessAsync(int id);

        /// <summary>
        /// 批量删除工序
        /// </summary>
        /// <param name="ids">工序ID列表</param>
        /// <returns>删除结果</returns>
        Task<ApiResult<bool>> BatchDeleteProcessesAsync(List<int> ids);

        /// <summary>
        /// 导出工序到Excel
        /// </summary>
        /// <param name="queryDto">查询条件</param>
        /// <returns>Excel文件字节数组</returns>
        Task<byte[]> ExportProcessesToExcelAsync(ProcessExportQueryDto queryDto);

        /// <summary>
        /// 生成工序编码
        /// </summary>
        /// <returns>生成的工序编码</returns>
        Task<ApiResult<string>> GenerateProcessCodeAsync();
    }
} 